package com.xingkeduo.service;

import com.xingkeduo.model.param.BatchLockStockParam;
import com.xingkeduo.model.param.StockParam;
import com.xingkeduo.model.po.TStaffStock;
import com.xingkeduo.model.vo.*;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Author: 中文输入法发挥不稳定的刘川
 * @Date: 19-3-13 下午8:25
 */
public interface StaffStockService {

    /**
     * @param staffStockList
     * @return int
     * @description 批量插入库存
     * @author 中文输入法发挥不稳定的刘川
     * @date 19-3-20 下午9:06
     */
    int batchInsertStaffStock(List<TStaffStock> staffStockList);


    Integer getStaffNumInShop(Date date, Long shopId);

    List<TStaffStock> getEnableStockListByDateAndStoreId(Date date, Long shopId);

    List<TStaffStock> getEnableStockListByDateAndStoreIdAndStaffId(Date date, Long shopId, Long staffId);

    List<TStaffStock> getIdAndStaffIdByDateAndStoreId(Date date, Long shopId);


    int updateBatchStockToSystemOccupyByIdList(List<Long> idList);

    List<TStaffStock> getNewStockListAfterMove(List<TStaffStock> sourceStockList,List<TStaffStock> targetStockList);

    int deleteStockByIdList(List<Long> idList);

    int deleteStockByDateAndStoreId(Date date,Long storeId );

    int deleteStockByAttendanceIdList(List<Long> attendanceIdList);

    int deleteStockByDateAndstaffId(Date date, Long statffId);

    int deleteStockByDateAndstaffIdAndStoreId(Date date, Long statffId, Long storeId);

    int updateStockStatusByStoreIdAndDate(Date date, Long storeId);

    int unableStockByStoreIdAndStaffIdAndWeek(Long storeId,Long staffId,List<Date> dateList);

    int updateServerTimeAndBusinessTime(String shopId, String serverTime, String businessTime, String modifier);

    /** 锁定库存 **/
    int lockStockBystockId(Long stockId, Long orderNo, byte status, String lineNo, String userPath, Long storeId);
    /** 批量锁定库存 **/
    int batchLockStockBystockId(List<BatchLockStockParam> batchLockStockParams);
    /** 释放库存 **/
    int unlockStockBystockId(Long storeId, Long orderNo);
    /** 批量释放库存 **/
    int batchUnlockStockBystockId(List<BatchLockStockParam> batchLockStockParams);
    /** 改约单库存的逻辑 **/
    int changeStockBystockIdAndorderNo(Long storeId, Long orderNo, Long stockId, Byte status, String lineNo);

    Map<String, StockVo> getStaffStock(Long staffId, Long storeId, String starDate);

    int updateStockStatusRestOrOccupy(Long id ,byte status,Long managerId);

    StockSmallProgramVo getStockIdByStaffIdAndStoreId(Long staffId, Long storeId, String startTime, String selectDate);

    List<StockSmallProgramVo> getStockIdByStaffIdAndBaberStoreId(Long staffId, Long storeId, String startTime, String selectDate);

    List<StockWorkTimeVo> getMinFreeStockByStoreId(Long storeId, String selectDate);

    /** 根据指定时间查询当前店铺第二天及以后的所有带有订单的库存 **/
    List<Long> getStocksByDateAndStoreId (Long shopId, List<Long> staffIds, Date selectDate);

    List<OrderInfoVo> stockOrder(Long shopId, List<Long> staffIds, Date selectDate);

    /** 锁定指定员工最早可约空闲库存 **/
    StockForOrderVo lockMinFreeStock(StockParam stockParam);

    LineNumVo getLineNum(String dateTime, String staffId, String storeId);

    OrderScreenVo getOrderScreenStock(String storeId);

    void receiveStaffId(Long staffId);

    /**CMS查看发型师库存*/
    CmsShopInfoVo getShopStockInfo(String date,Long storeId);

    /**API查看发型师库存*/
    ApiShopInfoVo getApiShopStockInfo(String date,Long storeId);

    Boolean getStockIsEnable(Long storeId, Long orderNo);

}
